<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>空间平移</title>
  <style>
    div {
      width: 200px;
      height: 200px;
      margin: 100px auto;
      background-color: pink;
      transition: all .5s;
    }
    .box:hover {
      /* 电脑是平面, 默认无法观察z轴平移效果; translate3d属性的参数必须是3个参数,否则不生效 */
      /* transform: translate3d(100px, 200px, 300px); */

      transform: translateX(100px);
      transform: translateY(-100%);
      /* transform: translateZ(300px); */
    }
  </style>
</head>
<body>
  <div class="box"></div>
</body>
</html>